#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 9e18;
const int INF = 0x3f3f3f3f;
int dx[4] = {0,0,-1,1};
int dy[4] = {-1,1,0,0};
const int N = 1000 + 7;
int h,w;
char a[N][N];
char ans[N][N];
bool vis[N][N];

int dis[N][N];
struct node
{
    int x,y,step;
};

class cmp
{
public:
    bool operator()(const node& v1,const node& v2)const
    {
        return v1.step > v2.step;
    }
};

void bfs(int i,int j)
{

    dis[i][j] = 0;
    priority_queue<node,vector<node>,cmp> q;
    q.push({i,j,0});

    while(!q.empty())
    {
        auto t = q.top();
        q.pop();
        int x = t.x,y = t.y;
        int st = t.step;
        
        for(int k = 0;k < 4;k++)
        {
            int nx = dx[k] + x,ny = dy[k] + y;
            if(nx <= 0 || nx > h || ny <= 0 || ny > w || a[nx][ny] == '#') continue;
            if(a[nx][ny] == 'E')
            {
                dis[nx][ny] = 0;
                q.push({nx,ny,0});
                continue;
            }
            if(st + 1 < dis[nx][ny])
            {
                dis[nx][ny] = st + 1;
                q.push({nx,ny,st + 1});
            }
        }
    }
}

void solve()
{

    int h, w;
     cin >> h >> w;
     vector<string> s(h);
     for (int i = 0; i < h; i++)  cin >> s[i];
     map<array<int, 2>, char> mp;
     mp[{-1, 0}] = 'v';
     mp[{1, 0}] = '^';
     mp[{0, 1}] = '<';
     mp[{0, -1}] = '>';

     priority_queue<array<int, 3>, vector<array<int, 3>>, greater<array<int, 3>>> q;
     for(int i = 0; i < h; i++)
     {
        for(int j = 0; j < w; j++)
        {
            if(s[i][j] == 'E') q.push({0, i, j});
        }
     }

     while(!q.empty())
     {
        auto [d, x, y] = q.top();
        q.pop();
        
        for(int i = 0; i < 4; i++)
        {
            int nx = x + dx[i], ny = y + dy[i];
            if(nx < 0 || nx >= h || ny < 0 || ny >= w) continue;
            if(s[nx][ny] != '.') continue;
            s[nx][ny] = mp[{dx[i], dy[i]}];
            q.push({d + 1, nx, ny});
        }
     }
    
     for(int i = 0; i < h; i++)
     cout << s[i] << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    // cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}